
// const linpengapi = () => import(/* webpackChunkName: "linpengapi666" */ '../libs/linpengapi.common.js');
// import * as linpengapi from '../libs/linpengapi.umd.js';
// console.log('linpengapi', linpengapi);
import linpengapi from '../../../linpengapi/index.js';
window.linpengapi = linpengapi;
let apis = new window.linpengapi.PHPAPI({
    doLogin: {
        url: '/api/user/account/login',
        method: 'post',
        options: {
            auth: false,
        },
    },
    getOrg: {
        url: '/api/user/account/getOrgInfo',
        method: 'get',
        options: {
            auth: true,
        },
    },
    getAllSubjectByPeriod: {
        url: '/api/knowledge/book/volumne/getAllSubjectByPeriod',
    },
}, {
    toast: (p) => {
        window.Vue.prototype.$message(Object.assign({}, p, { duration: 5000 }));
    },
}
);

let api = new window.linpengapi.PHPAPI({
    getAllSubjectByPeriod: {
        url: '/api/knowledge/book/volumne/getAllSubjectByPeriod',
        options: {
            auth: false,
            errorTip: false,
            baseURL: 'http://proj289test.anoah.com',
        },
    },
    exportUrserList: {
        url: '/api/user/account/exportList',
        options: {
            alien: true,
            // auth: true,
            responseType: 'arraybuffer',
        },
    },
}, { baseURL: 'http://proj561dev.anoah.com' }
);

let externalApi = new window.linpengapi.PHPAPI({
    getPublishTotalInSection: {
        url: 'http://e.dev.anoah.com/api/?q=json/ebag/Course/getPublishTotalInSection',
        method: 'post',
        options: {
            auth: false,
        },
        before: (r) => {
            console.log(r);
        },
    },
    getPublishTotalInSection2: {
        url: 'http://e.dev.anoah.com/api/?q=json/ebag/Course/getPublishTotalInSection',
        method: 'post',
        options: {
            auth: false,
        },
        before: (r) => {
            console.log(r);
        },
    },
    getOcr: {
        url: 'http://192.168.45.18:9111/api/utility/ocr/youDaoOcr',
        method: 'upload',
        options: {
            auth: false,
        },
        before: (r) => {
            console.log(r);
        },
    },
});

let jwtApi = new window.linpengapi.PHPAPI({
    getUserBookLeftUp: {
        url: '/api/resource/prepareLesson/scheme/getUserBookLeftUp',
        method: 'post',
        options: {
            auth: true,
            errorTip: true,
        },
    },

    prepareLessonSectionAdd: {
        url: '/api/resource/prepareLesson/scheme/section/add',
        method: 'post',
        options: {
            auth: true,
            // errorTip: false,
        },
    } }, { toast: (p) => { window.Vue.prototype.$message(Object.assign({}, p, { duration: 5000 })); } }
);

export default apis;
export { apis, api, externalApi, jwtApi };
